<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>微会员申请</title>
<meta name="decorator" content="default" />
<meta name="viewport"
	content="width=device-width initial-scale=1.0  maximum-scale=1.0">
<%@ include file="/static/mobile-template/default/header.jsp"%>
<script type="text/javascript">
	$(document).ready(function() {
		document.title = "微会员申请";
	});

	function checkForm(){
		var tel = $('#mobile').val();
		var nick = $('#nickName').val();
		
		if(nick == null || nick ==''){
			alert("请输入您的姓名.");
		}
		
		
		
		if(tel == null || tel ==''){
			alert('请输入手机号。');
			return false;
		}else{
			if(/^1[3,4,5,8]\d{9}$/g.test(tel)||(/^15[8,9]\d{8}$/g.test(tel))){
				return true;
			}else{
				alert('手机号输入不正确。');
				return false;
			}
		}
		return true;
	}
</script>

</head>
<body>

	<div class="main">
		<div>
			<div>
				<div class="ztContent">
					<div data-role="header" align="center" style="margin:10px;">
						<h3>微会员申请</h3>
					</div>
					<!-- /header -->
					<c:if test="${reg eq 'reg' }">
						<form id="inputForm" action="${ctxFront}/wechat/bind/${id}" method="post" onsubmit=" return checkForm();">
							<input type="hidden" name="action" value="reg" /> 
							<input	type="hidden" name="topage" value="${topage }" />
							<input	type="hidden" name="wechatId" value="${wechatId }" />
							<div align="center">
								<div class="control-group">
									<div class="controls" align="left">
										姓名:&nbsp;&nbsp;<input name="name"  type="text" id="nickName"
											maxlength="50" class="required" />
									</div>
								</div>

								<div class="control-group">
									<div class="controls" align="left">
										手机:&nbsp;&nbsp;<input name="mobile" id="mobile" type="text" 
											maxlength="15" class="required digits" />
									</div>
								</div>
								
								<div class="control-group">
									<div class="controls" align="left">
										性别：&nbsp;&nbsp;
										 
										<select name="sex">
											<option value="女">女</option>
											<option value="男">男</option>
											<option value="保密">保密</option>
										</select>
									</div>
								</div>
								
								<div class="control-group">
									<div class="controls" align="left">
										生日:&nbsp;&nbsp;<input name="birthday" id="mobile" type="text" 
											maxlength="8" class="required digits" placeholder="日期格式:19880808" />
									</div>
								</div>
								
								<div   align="center" class="alert">
										<span  style="color:red" >注意</span>:手机号将作为微信会员的唯一标记且一个微信号只能与一个手机号绑定，我们不会将您的任何信息泄露给任何第三方，请认真填写您的信息。
								</div>
								
								<div   align="center">
									<input id="btnSubmit" class="btn btn-danger" type="submit"
										value="确 定" />
								</div>
							</div>
						</form>

					</c:if>
					<div  align="center" class="alert">
									<h4>${message }</h4>
									 <br>
									<h5 style="color:red">${regLottery}</h5>
					</div>
				</div>
			</div>
		</div>
	</div>
	<c:if test="${uid ne '34' }">
		<jsp:include page="/static/mobile-template/default/footer.jsp">
			<jsp:param value="${id }" name="uid"/>
		</jsp:include>
	</c:if>
</body>
</html>
